package com.example.smart_video.utils;


import com.danikula.videocache.file.FileNameGenerator;
import com.wink_172.library.utils.FileUtil;

public class MyFileNameGenerator implements FileNameGenerator {

    // Urls contain mutable parts (parameter 'sessionToken') and stable video's id (parameter 'videoId').
    // e. g. http://example.com?videoId=abcqaz&sessionToken=xyz987
    public String generate(String url) {
//        Uri uri = Uri.parse(url);
//        String videoId = uri.getQueryParameter("videoId");
//        return  "hello.mp4";
        return FileUtil.Companion.getFileNameWithSuffix(url);//原封不动的文件名
    }
}